<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>选课人数</title>
</head>
<body>
	<center>
		<h3><font style="color:#ff0000;" id="course_name">课程</font>&nbsp;选课情况</h3>		
	</center>
	<br>
	主选学生限制人数：<span id="primary"></span>&nbsp;&nbsp;已选人数：<span id="pri"></span>
	<br>
	非主选学生限制人数：<span id="secondary"></span>&nbsp;&nbsp;已选人数：<span id="sec"></span>
	
	
	<script src="dist/js/bootstrap.js"></script>
	<script src="dist/js/jquery-2.2.3.min.js"></script>
	<script src="dist/js/bootstrap.js"></script>
	<script src="dist/js/bootstrap-table.js"></script>
	<script src="dist/js/bootstrap-table-zh-CN.js"></script>
	
	<script type="text/javascript">
		var courseID;
		courseID = <%=(String)request.getParameter("courseID")%>;
		$(document).ready(function(){
			//getCourseInfo();
			//getNumberInfo();
		});
		
		function getCourseInfo() {
			$.ajax({
				url:'/ui/get-course-by-pk',
				data:{
					courseID : courseID
				},
				type:'POST',
				dataType:'json',
				success:function(data){					
					$("#course_name").html(data.name);
					$("#primary").html(data.primaryLimit);
					$("#secondary").html(data.secondaryLimit);				
				},
				error:function() {
					alert("该学院课程选课人数加载失败,请刷新重试!");
				} 
			});
		}
		
		//这里获取实际的选课人数
		function getNumberInfo() {
			$.ajax({
				url:'/ui/get-course-by-pk',
				data:{
					courseID : courseID
				},
				type:'POST',
				dataType:'json',
				success:function(data){
					$("#pri").html(data.primaryLimit);
					$("#sec").html(data.secondaryLimit);				
				},
				error:function() {
					alert("该学院课程选课人数加载失败,请刷新重试!");
				} 
			});
		}
	</script>
</body>
</html>